from fdfs_client.client import Fdfs_client


if __name__ == '__main__':

    client = Fdfs_client('client.conf')
    # ret = client.upload_by_filename('/home/wulibb/Pictures/meizi.jpg')
    ret = client.delete_file('group1/M00/00/02/wKhUrV0UzBSAOh_QAAJABOxQKqY5651525')
    print(ret)

"""
ret = {
'Group name': 'Storage组名',
'Remote file_id': '文件索引，可用于下载',
'Status': '文件上传结果反馈',
'Local file name': '上传文件全路径',
'Uploaded size': '文件大小',
'Storage IP': 'Storage地址'
 }
 {'Group name': 'group1', 
 'Remote file_id': 'group1/M00/00/02/wKhUrV0UbUKAAhBkAAJABOxQKqY691.jpg', 
 'Status': 'Upload successed.', 
 'Local file name': '/home/wulibb/Pictures/meizi.jpg', 
 'Uploaded size': '144.00KB', 
 'Storage IP': '192.168.84.173'}
 
# 删除成功
('Delete file successed.', 'group1/M00/00/02/wKhUrV0UzBSAOh_QAAJABOxQKqY5651525', '192.168.84.173')
# 不存在则抛出错误 
fdfs_client.exceptions.DataError: Error: 2, No such file or directory
 """
# http://192.168.84.173:8888/group1/M00/00/02/wKhUrV0UbUKAAhBkAAJABOxQKqY691.jpg

